import request from "@/utils/request";
import {PATH_SYS_DNF} from "@/utils/constant";
import {Money} from "@/api/sys/dnf/money/types";

const baseUrl = PATH_SYS_DNF + '/money/'

/**
 * 查询充值列表 - 带分页
 */
export function getMoneyListApi(): Promise<Money[]> {
    return request.get(baseUrl+'list')
}

/**
 * 通过充值id获取充值信息
 * @param id
 */
export function getMoneyByIdApi(id: number): Promise<Money> {
    return request.get(baseUrl + id)
}

/**
 * 修改充值
 * @param id
 * @param data
 */
export function editMoneyApi(id: number, data: Money): Promise<any> {
    return request.patch(baseUrl + id, data)

}

/**
 * 添加充值
 * @param data
 */
export function addMoneyApi(data: Money): Promise<any> {
    return request.post(baseUrl, data)
}

/**
 * 删除充值
 * @param id
 */
export function deleteMoneyApi(id: number): Promise<any> {
    return request.delete(baseUrl + id)
}

/**
 * 签到
 */
export function signMoneyApi(){
    return request.post(baseUrl+'sign')
}